import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/home'
    },
    {
      path: '/',
      name: 'index',
      component: (resolve) => require(['./views/index.vue'], resolve),
      children: [
        {
          path: '/home',
          name: '首页',
          component: (resolve) => require(['./views/home.vue'], resolve)
        },
        {
          path: '/grid-view',
          name: '九宫格布局',
          component: (resolve) => require(['./views/case-pages/grid-view.vue'], resolve)
        },
        {
          path: '/leftbar-view',
          name: '左侧bar实现方式',
          component: (resolve) => require(['./views/case-pages/leftbar-view.vue'], resolve)
        },
        {
          path: '/colorborder-view',
          name: '盒子模型',
          component: (resolve) => require(['./views/case-pages/color-border-view.vue'], resolve)
        },
        {
          path: '/stacklevel-view',
          name: '层叠水平',
          component: (resolve) => require(['./views/case-pages/stack-level-view.vue'], resolve)
        },
        {
          path: '/reflect-view',
          name: '倒影效果',
          component: (resolve) => require(['./views/case-pages/reflect-view.vue'], resolve)
        },
        {
          path: '/textcenter-view',
          name: '文字居中inherit',
          component: (resolve) => require(['./views/case-pages/text-center-view.vue'], resolve)
        }
      ]
    }
  ]
})
